package com.book.manager.dao;

import com.book.manager.pojo.Orders;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface OrdersDAO extends JpaRepository<Orders,Integer> {
    void deleteById(int id);
    Orders findById(int id);

    List<Orders> findAllByType(int type);

    List<Orders> findAllByIdAndType(int id,int type);

    List<Orders> findAllByStatus(int status);

    @Query("select id from Orders where serialid = ?1")
    int findOrderIdBySerialid(Integer serialid);
}
